<?php
namespace app\common\logic;
use app\partner\logic\Logic;
use app\common\model\RegionModel;

class AreaLogic extends Logic
{
    //获得省份
    public function getProvince()
    {
        $country = Request::instance()->param('country');
        $regionModel = new RegionModel();
        $result = $regionModel->where('parent_id', $country)->select();
        return $result;
    }

    //获得市
    public function getCity()
    {
        $city= Request::instance()->param('city');
        $regionModel = new RegionModel();
        $result = $regionModel->where('parent_id', $city)->select();
        return $result;
    }

    //获得县
    public function getArea()
    {
        $area= Request::instance()->param('area');
        $regionModel = new RegionModel();
        $result = $regionModel->where('parent_id', $area)->select();
        return $result;
    }

    //获得农村街道
    public function getCountryside()
    {
        $area= Request::instance()->param('countryside');
        $regionModel = new RegionModel();
        $result = $regionModel->where('parent_id', $area)->select();
        return $result;
    }

}
